#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  decopara.py
#       Author @  Huoty
#  Create date @  2015-08-12 11:13:30
#  Description @
# *************************************************************

def deco(pm):
    def _deco(func):
        def __deco(*args, **kw):
            ret =func(*args, **kw)
            print "func result: ", ret
            return ret ** pm
        return __deco
    return _deco

@deco(2)
def foo(x, y, z=1):
    return x + y + z

print "deco_func result: %s" % foo(10, 20)
